Overview
gdal2gores.py transforms a Simple Cylindrical map projected image into an image with n gores, suitable for printing maps on spheres like tennis balls or globes. The script remaps pixels using an interrupted sinusoidal projection pattern.
Purpose
Given a Simple Cylindrical map projected image, this tool remaps it to an image with multiple gores for placing or printing the map on a spherical surface. Author: Trent Hare, USGSCredits: Based on C# implementation by Michal Wisniewski (winski software)
Installation Requirements
Command Syntax
Parameters
Number of gores to generate in the output file, based on interrupted sinusoidal projection
Quiet mode - suppresses progress output
Input Simple Cylindrical map projected image (any GDAL-supported format)
Output filename (currently defaults to GeoTIFF format)
Usage Examples
Basic Gore Generation
Generate a gore map with the default 8 gores:Custom Number of Gores
Create a 12-gore pattern for a globe:Quiet Mode
Run without progress output:How It Works
The gore transformation algorithm:- Gore Width Calculation: Divides the input image width by the number of gores
- Pixel Remapping: For each gore, pixels are repositioned using cosine transformation:
- Edge Overlap: Uses rounding to increase overlap at gore edges for better alignment
- Sequential Processing: Processes line-by-line to handle large images efficiently
Technical Details
Output Characteristics
- Format: GeoTIFF (currently hardwired)
- Size: Same dimensions as input image
- Bands: Preserves all bands from input
- Data Type: Matches input image data type (Byte, Int16, etc.)
- Projection: No projection metadata (this is a gore image)
Processing Notes
The script processes images line-by-line, making it capable of handling very large images without memory issues.
- Processes each band separately
- Iterates over lines in reverse order (bottom to top)
- Each gore is processed independently within each scanline
- Progress is displayed per band unless quiet mode is enabled
Practical Applications
Creating Sphere Maps
- Print and Cut: Print the gore image and cut along gore boundaries
- Apply to Sphere: Align and glue each gore section onto a spherical surface
- Tennis Ball Maps: Perfect for DIY planetary globes on tennis balls
Globe Manufacturing
The gore pattern follows standard globe manufacturing techniques where flat map segments are arranged to minimize distortion when applied to spherical surfaces.Example Workflow
Source Code Reference
The core transformation logic is located in:gdal2gores.py:131-144- Gore iteration and pixel remappinggdal2gores.py:138-139- Cosine transformation for pixel positioning